.class public Lcom/ninesky/browser/cr;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/widget/ExpandableListAdapter;


# instance fields
.field private a:[I

.field private b:I

.field private c:Ljava/util/Vector;

.field private d:Landroid/database/Cursor;

.field private e:Landroid/webkit/DateSorter;

.field private f:I

.field private g:I

.field private h:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/database/Cursor;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lcom/ninesky/browser/cr;->h:Landroid/content/Context;

    new-instance v0, Landroid/webkit/DateSorter;

    invoke-direct {v0, p1}, Landroid/webkit/DateSorter;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/ninesky/browser/cr;->e:Landroid/webkit/DateSorter;

    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    iput-object v0, p0, Lcom/ninesky/browser/cr;->c:Ljava/util/Vector;

    iput-object p2, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    const-string v0, "_id"

    invoke-interface {p2, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/ninesky/browser/cr;->g:I

    new-instance v0, Lcom/ninesky/browser/y;

    invoke-direct {v0, p0}, Lcom/ninesky/browser/y;-><init>(Lcom/ninesky/browser/cr;)V

    invoke-interface {p2, v0}, Landroid/database/Cursor;->registerContentObserver(Landroid/database/ContentObserver;)V

    const/4 v0, 0x3

    iput v0, p0, Lcom/ninesky/browser/cr;->f:I

    invoke-direct {p0}, Lcom/ninesky/browser/cr;->c()V

    return-void
.end method

.method private c(I)J
    .locals 2

    iget-object v0, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v0, p1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v0

    return-wide v0
.end method

.method private c()V
    .locals 5

    const/4 v3, 0x5

    const/4 v2, 0x0

    new-array v0, v3, [I

    move v1, v2

    :goto_0
    if-lt v1, v3, :cond_1

    iput v2, p0, Lcom/ninesky/browser/cr;->b:I

    const/4 v1, -0x1

    iget-object v2, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v2}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    if-eqz v2, :cond_0

    iget-object v2, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v2}, Landroid/database/Cursor;->getCount()I

    move-result v2

    if-lez v2, :cond_0

    :goto_1
    iget-object v2, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v2}, Landroid/database/Cursor;->isAfterLast()Z

    move-result v2

    if-eqz v2, :cond_2

    :cond_0
    :goto_2
    iput-object v0, p0, Lcom/ninesky/browser/cr;->a:[I

    return-void

    :cond_1
    aput v2, v0, v1

    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_2
    iget v2, p0, Lcom/ninesky/browser/cr;->f:I

    invoke-direct {p0, v2}, Lcom/ninesky/browser/cr;->c(I)J

    move-result-wide v2

    iget-object v4, p0, Lcom/ninesky/browser/cr;->e:Landroid/webkit/DateSorter;

    invoke-virtual {v4, v2, v3}, Landroid/webkit/DateSorter;->getIndex(J)I

    move-result v2

    if-le v2, v1, :cond_4

    iget v1, p0, Lcom/ninesky/browser/cr;->b:I

    add-int/lit8 v1, v1, 0x1

    iput v1, p0, Lcom/ninesky/browser/cr;->b:I

    const/4 v1, 0x4

    if-ne v2, v1, :cond_3

    iget-object v1, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v1}, Landroid/database/Cursor;->getCount()I

    move-result v1

    iget-object v3, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v3}, Landroid/database/Cursor;->getPosition()I

    move-result v3

    sub-int/2addr v1, v3

    aput v1, v0, v2

    goto :goto_2

    :cond_3
    move v1, v2

    :cond_4
    aget v2, v0, v1

    add-int/lit8 v2, v2, 0x1

    aput v2, v0, v1

    iget-object v2, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v2}, Landroid/database/Cursor;->moveToNext()Z

    goto :goto_1
.end method

.method private d(I)I
    .locals 3

    const/4 v1, 0x5

    if-ltz p1, :cond_0

    if-lt p1, v1, :cond_1

    :cond_0
    new-instance v0, Ljava/lang/AssertionError;

    const-string v1, "group position out of range"

    invoke-direct {v0, v1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V

    throw v0

    :cond_1
    iget v0, p0, Lcom/ninesky/browser/cr;->b:I

    if-eq v1, v0, :cond_2

    iget v0, p0, Lcom/ninesky/browser/cr;->b:I

    if-nez v0, :cond_4

    :cond_2
    move v0, p1

    :cond_3
    return v0

    :cond_4
    const/4 v0, -0x1

    move v1, p1

    :cond_5
    :goto_0
    if-ltz v1, :cond_3

    add-int/lit8 v0, v0, 0x1

    iget-object v2, p0, Lcom/ninesky/browser/cr;->a:[I

    aget v2, v2, v0

    if-eqz v2, :cond_5

    add-int/lit8 v1, v1, -0x1

    goto :goto_0
.end method


# virtual methods
.method final a(I)I
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v0, p1}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    return v0
.end method

.method final a(II)Z
    .locals 4

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->isClosed()Z

    move-result v0

    if-eqz v0, :cond_0

    move v0, v1

    :goto_0
    return v0

    :cond_0
    invoke-direct {p0, p1}, Lcom/ninesky/browser/cr;->d(I)I

    move-result v0

    move v2, p2

    :goto_1
    if-lt v1, v0, :cond_1

    iget-object v0, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v0, v2}, Landroid/database/Cursor;->moveToPosition(I)Z

    move-result v0

    goto :goto_0

    :cond_1
    iget-object v3, p0, Lcom/ninesky/browser/cr;->a:[I

    aget v3, v3, v1

    add-int/2addr v2, v3

    add-int/lit8 v1, v1, 0x1

    goto :goto_1
.end method

.method final a()[B
    .locals 2

    iget-object v0, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    const/4 v1, 0x6

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v0

    return-object v0
.end method

.method public areAllItemsEnabled()Z
    .locals 1

    const/4 v0, 0x1

    return v0
.end method

.method final b(I)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v0, p1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method final b()V
    .locals 2

    iget-object v0, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->isClosed()Z

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->requery()Z

    invoke-direct {p0}, Lcom/ninesky/browser/cr;->c()V

    iget-object v0, p0, Lcom/ninesky/browser/cr;->c:Ljava/util/Vector;

    invoke-virtual {v0}, Ljava/util/Vector;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/database/DataSetObserver;

    invoke-virtual {p0}, Landroid/database/DataSetObserver;->onChanged()V

    goto :goto_0
.end method

.method public getChild(II)Ljava/lang/Object;
    .locals 1

    const/4 v0, 0x0

    return-object v0
.end method

.method public getChildId(II)J
    .locals 2

    invoke-virtual {p0, p1, p2}, Lcom/ninesky/browser/cr;->a(II)Z

    move-result v0

    if-eqz v0, :cond_0

    iget v0, p0, Lcom/ninesky/browser/cr;->g:I

    invoke-direct {p0, v0}, Lcom/ninesky/browser/cr;->c(I)J

    move-result-wide v0

    :goto_0
    return-wide v0

    :cond_0
    const-wide/16 v0, 0x0

    goto :goto_0
.end method

.method public getChildView(IIZLandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 1

    const/4 v0, 0x0

    return-object v0
.end method

.method public getChildrenCount(I)I
    .locals 2

    iget-object v0, p0, Lcom/ninesky/browser/cr;->a:[I

    invoke-direct {p0, p1}, Lcom/ninesky/browser/cr;->d(I)I

    move-result v1

    aget v0, v0, v1

    return v0
.end method

.method public getCombinedChildId(JJ)J
    .locals 0

    return-wide p3
.end method

.method public getCombinedGroupId(J)J
    .locals 0

    return-wide p1
.end method

.method public getGroup(I)Ljava/lang/Object;
    .locals 1

    const/4 v0, 0x0

    return-object v0
.end method

.method public getGroupCount()I
    .locals 1

    iget v0, p0, Lcom/ninesky/browser/cr;->b:I

    return v0
.end method

.method public getGroupId(I)J
    .locals 2

    int-to-long v0, p1

    return-wide v0
.end method

.method public getGroupView(IZLandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 3

    if-eqz p3, :cond_0

    instance-of v0, p3, Landroid/widget/TextView;

    if-nez v0, :cond_1

    :cond_0
    iget-object v0, p0, Lcom/ninesky/browser/cr;->h:Landroid/content/Context;

    invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    const v1, 0x7f030010

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    :goto_0
    iget-object v1, p0, Lcom/ninesky/browser/cr;->e:Landroid/webkit/DateSorter;

    invoke-direct {p0, p1}, Lcom/ninesky/browser/cr;->d(I)I

    move-result v2

    invoke-virtual {v1, v2}, Landroid/webkit/DateSorter;->getLabel(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    return-object v0

    :cond_1
    check-cast p3, Landroid/widget/TextView;

    move-object v0, p3

    goto :goto_0
.end method

.method public hasStableIds()Z
    .locals 1

    const/4 v0, 0x1

    return v0
.end method

.method public isChildSelectable(II)Z
    .locals 1

    const/4 v0, 0x1

    return v0
.end method

.method public isEmpty()Z
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->isClosed()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/cr;->d:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public onGroupCollapsed(I)V
    .locals 0

    return-void
.end method

.method public onGroupExpanded(I)V
    .locals 0

    return-void
.end method

.method public registerDataSetObserver(Landroid/database/DataSetObserver;)V
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/cr;->c:Ljava/util/Vector;

    invoke-virtual {v0, p1}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public unregisterDataSetObserver(Landroid/database/DataSetObserver;)V
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/cr;->c:Ljava/util/Vector;

    invoke-virtual {v0, p1}, Ljava/util/Vector;->remove(Ljava/lang/Object;)Z

    return-void
.end method
